import java.util.*;
import java.util.stream.Stream;

public class Task {

    public static void main(String[] args) {
        
        // 为List创建流
        Stream<String> stream = getStream();
        stream.forEach(System.out::println);

        // 为Set创建流
        Stream<String> stream2 = getStream2();
        stream2.forEach(System.out::println);
        
        // 为Map创建流
        Stream<Map.Entry<String, Integer>> stream3 = getStream3();
        stream3.forEach(System.out::println);
        
        // 为数组创建流
        Stream<String> stream4 = getStream4();
        stream4.forEach(System.out::println);

        // 为任意长度参数创建流
        /* TODO */
    }

    public static Stream<String> getStream4() {
        String[] array = {"a", "b", "c", "d", "e"};
        /* TODO */
    }

    private static Stream<Map.Entry<String, Integer>> getStream3() {
        Map<String, Integer> map = new HashMap<>();
        map.put("a", 1);
        map.put("b", 2);
        map.put("c", 3);
        map.put("d", 4);
        /* TODO */
    }

    public static Stream<String> getStream2() {
        Set<String> set = new HashSet<>();
        Collections.addAll(set, "a", "b", "c", "d", "e", "c");
        /* TODO */
    }

    private static Stream<String> getStream() {
        String[] array = {"a", "b", "c", "d", "e"};
        /* TODO */
    }

}